<?php if(!IS_AJAX){?>
<include file="Public:header" />
<style>
    .selectlist { margin: 0; padding: 0; }
    .selectlist li { list-style-type: none; margin: 0; padding: 0; padding: 5px; border-bottom: 1px solid #eee; margin: 0 8px; }
    .selectlist li:hover { background: #eee; }
    .selectlist li>ul>li:hover { background: #E7E7E7; }
    .avatarEdit{
        background: rgba(0,0,0,.3);
        position: absolute;
        top: 82px;
        left: 20px;
        padding-top: 4px;
        padding-right: 5px;
        width: 100px;
        height: 25px;
        color: #fff;
        text-align: center;
        z-index: 999;
        display:none;
    }
    .avatarEdit:hover{
        cursor:pointer;
    }
    .avatitle{color:#222;}
    .avacont{color:#8d8d8d}
</style>
<div class="row">
    <div class="col-lg-12" id="ListDataBox">
        <div class="panel modal-open"  data-step="4" data-intro="此处查看个人资料" data-position="left">
            <div class="panel-heading">
                <span class="pagetitle">个人资料</span>
            </div>
            <form action="" id="ajaxlistboxform">
                <input type="hidden" name="symbol" value="0">
                <input type="hidden" name="tel" value="{$info.tel}">
                <input type="hidden" name="Email" value="{$info.Email}">
                <input type="hidden" name="QQ" value="{$info.QQ}">
                <input type="hidden" name="remark" value="{$info.remark}">
            </form>
            <div class="panel-body" style="padding-top:38px;padding-left:50px;">
                <div class="form-horizontal" id="ajaxlistbox">
                    <?php    }?>
                    <form action="{:U('Member/edit')}" class="checkoutform" method="post">
                        <!-- 数据主体 -->
                        <?php if(IS_AJAX){?>
                        <input type="hidden" name="symbol" value="1">
                        <div class="form-group">
                            <div>
                                <label class="col-lg-2 col-sm-4 control-label avatitle" style="height:34px">
                                    <!--{$info.img_url}-->
                                    <img id="headimg" src="<empty name='info.img_url'>__PUBLIC__/timg.jpg<else/>{$info.img_url}</empty>" alt="" style="width: 100px; height: 100px; position: absolute; left: 20px; z-index: 99; opacity: 1;cursor:pointer" />
                                    <span class="avatarEdit" onclick="_openWindow('{:U('Member/avatar')}',800,'上传头像','确认上传',function(){ $('#ajaxlistboxform').submit();return true;},'')">修改头像</span>
                                    姓名：</label>
                                <p class="col-lg-2 col-sm-2 form-control-static avacont">{$info.name}</p>
                                <label class="col-lg-1  col-sm-2 control-label avatitle">工号：</label>
                                <p class="col-lg-2 col-sm-2 form-control-static avacont">{$info.company_id}</p>
                            </div>
                        </div>
                        <div class="form-group">
                            <div>
                                <label class="col-lg-2 col-sm-4 control-label avatitle" style="height:34px">
                                    性别：</label>
                                <p class="col-lg-2  col-sm-2 form-control-static"><if condition='$info.sex eq 1'>男<else />女</if></p>
                                <label class="col-lg-1   col-sm-2 control-label avatitle">部门：</label>
                                <p class="col-lg-2 col-sm-2 form-control-static">{$info.memberpositionname}</p>
                            </div>
                        </div>
                        <div class="form-group">
                            <div>
                                <label class="col-lg-2 col-sm-4 control-label avatitle" style="height:34px">
                                    电话：</label>
                                <p class="col-lg-2  col-sm-2 form-control-static textpart avacont" style="display:block;">{$info.tel}</p>
                                <p class="col-lg-2  col-sm-2 form-control-static inputpart" style="display:none;">
                                    <input class="form-control" type="text" name="tel"  datatype="*6-11" errormsg="请输入正确的电话号码" value="{$info.tel}">
                                </p>
                                <label class="col-lg-1   col-sm-2 control-label avatitle">邮箱：</label>
                                <p class="col-lg-2 col-sm-4 form-control-static textpart avacont" style="display:block;">{$info.Email}</p>
                                <p class="col-lg-2 col-sm-4 form-control-static inputpart" style="display:none;">
                                    <input  class="form-control" type="text" name="Email" datatype="e" errormsg="请输入正确的邮箱格式" value="{$info.Email}">
                                </p>
                            </div>
                        </div>
                        <div class="form-group">
                            <div>
                                <label class="col-lg-2 col-sm-4 control-label avatitle" style="height:34px">
                                    Q Q：</label>
                                <p class="col-lg-2 col-sm-2 form-control-static textpart avacont"  style="display:block;">{$info.QQ}</p>
                                <p class="col-lg-2 col-sm-2 form-control-static inputpart" style="display:none;">
                                    <input  class="form-control" type="text" name="QQ" datatype="n6-13" errormsg="QQ格式不对!" value="{$info.QQ}">
                                </p>
                                <label class="col-lg-1 col-sm-2 control-label avatitle" style="height:34px">
                                    密码：</label>
                                <p class="col-lg-2  col-sm-4 form-control-static">
                                    <a href="javascript:void(0);" onclick="_openWindow('/322?g=Intesys&amp;m=Member&amp;a=editPwd',650, '修改密码', '退出',function(){ },'')">修改密码</a>
                                </p>
                            </div>
                        </div>
                        <div class="form-group">
                            <div>
                                <label class="col-lg-2   col-sm-4 control-label avatitle">个人介绍：</label>
                                <p class="col-lg-6 col-sm-8 form-control-static textpart avacont"  style="display:block;word-wrap:break-word;">{$info.remark}</p>
                                <p class="col-lg-6 col-sm-8 form-control-static inputpart" style="display:none;">
                                    <textarea  class="form-control" class="form-control" name="remark"  rows="6">{$info.remark}</textarea>
                                </p>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-lg-2   col-sm-4 control-label"></label>
                            <div class="col-lg-1 col-sm-2">
                                <button class="btn btn-success" type="button" id="formbtn">修改资料</button>
                            </div>
                        </div>
                        <!-- 数据主体结束 -->
                    </form>
                    <form action="{:U('Taskform/saveform')}" method="post" id="newformform">
                        <div class="panel" style="box-shadow: none;">
                            <div class="panel-heading">
                                详细信息
                            </div>
                            <div class="panel-body" id="thisrow">
                                {$newform}
                                <div style="margin:13px 0">
                                    <a href="javascript:void(0);" onClick="_openWindow('{:U('Employee/getNewform',['id'=>$info['id']])}',950,'修改资料','确定',function(){  window.location.reload();return true;},'')" >点击修改资料</a>
                                </div>
                            </div>
                        </div>
                    </form>
                    <?php } ?>
                    <?php if(!IS_AJAX){?>
                </div>
                <div id="ajaxlistboxpages" class="pagesBox text-center panel" style="display: none"> <?php echo $pages;?> </div>
            </div>
        </div>
    </div>
</div>
</div>
<include file="Public:script" />
<link rel="stylesheet" type="text/css" href="/Public/css/jquery.Jcrop.min.css" media="all">
<script type="text/javascript" src="/Public/Js/jquery.Jcrop.min.js"></script>
<script type="text/javascript">
    $('#ajaxlistbox').ajaxlist({
        success:function(){
            $('#headimg').mouseover(function(){
                $('.avatarEdit').show();
            });
            $('#headimg').mouseout(function(){
                $('.avatarEdit').hide();
            });
            $('.avatarEdit').mouseover(function(){
                $('.avatarEdit').show();
            });
            $('.avatarEdit').mouseout(function(){
                $('.avatarEdit').hide();
            });
            $('.checkoutform').Validform({
                ajaxPost:true,
                tiptype:function(msg, s, data){
                    if(s.type == 1){
//                        $.ThinkBox.success('正在处理，请稍等……',{'delayClose':0,modal:false, 'close': '关闭',x:0,y:0,center:false,locate:['left','top'], show:['',0]});
                    }
                    if(s.type == 3){
                        $.ThinkBox.error(msg,{'delayClose':500,modal:false, 'close': '关闭',x:0,y:0,center:false,locate:['left','top'], show:['',0]});
                    }
                },
                datatype:{
                    "text":function(gets,obj,curform,regxp){
                        return true;
                    },"image":function(gets,obj,curform,regxp){
                        return true;
                    }
                },
                callback:function(data){
                    if(data.status == 0){
                        $.ThinkBox.error(data.info,{'delayClose':200});
                    }else{
                        $.ThinkBox.success('操作成功',{'delayClose':1000,modal:false, 'close': '关闭',x:0,y:0,center:false,locate:['left','top'], show:['',0]});
                        $('#ajaxlistboxform').submit();
                    }
                }
            });
            $('#formbtn').toggle(
                function(){
                    $('.textpart').css({display:'none'});
                    $('.inputpart').css({display:'block'});
                    $(this).text('保存');
                },
                function(){
                    $('.checkoutform').submit();
                }
            );

            //格式化详细信息表
            $("#thisrow input[type='radio']").each(function(index, element) {
                if($(this).attr('checked')=='checked'){
                    var val = $(this).val();
                    $(this).parent('label').attr('style','font-weight:normal');
                    $(this).parent('label').removeClass('radio');
                    $(this).next('span').remove();
                    $(this).replaceWith('<span style="color:#8d8d8d;">'+val+'</span>');
                }else{
                    var val='';
                    $(this).parent().remove();
                    $(this).replaceWith('<span style="color:#8d8d8d;">'+val+'</span>');
                }
            });

            $('#thisrow .form-control ').each(function(index, element) {
                var hidden = $('.hidden').val();
                $('.hidden').replaceWith('');
                var val = $(this).val();
                $(this).replaceWith('<span style="color:#8d8d8d;">'+val+'</span>');
            });
            $('#thisrow td').css({height:'30px',lineHeight:'30px'});


        }
    });
</script>
</body></html><?php } ?>